<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="zozopo.operations.comm.*" %>
<%@taglib prefix="s" uri="/struts-tags"%>

<%@page import="zozopo.operations.manual.*" %>
<%@page import="zozopo.operations.business.*" %>
<%@page import="zozopo.database.*" %>
<%@page import="java.sql.*" %>
<html>
  <head>
    
    <title><s:property value="usermail"/> 添加正品网店 - Business</title>

<style>
	<!--
	table {
	table-layout: fixed;
	word-wrap:break-word;
	}
	td{
		
		word-break:break-all;
	}
	
BODY {
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; FONT-FAMILY: arial,san serif
}
	//-->
</style>
<script type="text/javascript" src="../comm/editor/editor.js" charset="gb2312"></script>
<script type="text/javascript" src="../jquery/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../jquery/rater/jquery.rater.packed.js"></script>
<script type="text/javascript" src="../jquery/rater/jquery.rater.zozopo.js"></script>
<link rel="stylesheet" type="text/css" href="../jquery/rater/rater.css" media="screen" /> 


<link type="text/css" href="../jquery/themes/base/jquery.ui.all.css" rel="stylesheet" />
	<script type="text/javascript" src="../jquery/ui/jquery.ui.core.js"></script>
	<script type="text/javascript" src="../jquery/ui/jquery.ui.widget.js"></script>
	<script type="text/javascript" src="../jquery/ui/jquery.ui.position.js"></script>
	<script type="text/javascript" src="../jquery/ui/jquery.ui.autocomplete.js"></script>
	<link type="text/css" href="../jquery/themes/cupertino/jquery-ui-1.8.4.custom.css" rel="stylesheet" />
	<link type="text/css" href="../jquery/demos.css" rel="stylesheet" />

	  <%
    BusiDatabaseManager databaseConnection = new BusiDatabaseManager();
	Connection conn = databaseConnection.getConnection();
    DictionaryOS dictionaryOS = new DictionaryOS(conn);
    StoreOS storeOS = new StoreOS(conn);
    BrandlogoOS brandlogoOS = new BrandlogoOS(conn);
%>

<script type="text/javascript">
	//加入输入框索引
	$(function() {
		var names = [<%
 		List<String> BrandList = storeOS.selectCnbrandList(0,100); 
								boolean isfirst = true;
 					     		for(String brand:BrandList){
 					     			if(!isfirst){
 					     				%>,"<%=brand%>"<%
 					     			}else{
 					     				isfirst = false;
 					     				%>"<%=brand%>"<%
 					     			}
								   }
								     	%>];

		var accentMap = {
			'á':'a',
			'?':'o'
		};
		
		var normalize = function( term ) {
			var ret = '';
			for ( var i = 0; i < term.length; i++ ) {
				ret += accentMap[ term.charAt(i) ] || term.charAt(i);
			}
			return ret;
		};

		$( "#cnbrand" ).autocomplete({
			source: function( request, response ) {
				var matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
				response( $.grep( names, function( value ) {
					value = value.label || value.value || value;
					return matcher.test( value ) || matcher.test( normalize( value ) );
				}) );
			}
		});
	});

	$(function() {
		var names = [<%
 		List<String> enbrandList = storeOS.selectEnbrandList(0,100); 
								boolean isfirst2 = true;
 					     		for(String brand:enbrandList){
 					     			if(!isfirst2){
 					     				%>,"<%=brand%>"<%
 					     			}else{
 					     				isfirst2	 = false;
 					     				%>"<%=brand%>"<%
 					     			}
								   }
								     	%>];

		var accentMap = {
			'á':'a',
			'?':'o'
		};
		
		var normalize = function( term ) {
			var ret = '';
			for ( var i = 0; i < term.length; i++ ) {
				ret += accentMap[ term.charAt(i) ] || term.charAt(i);
			}
			return ret;
		};

		$( "#enbrand" ).autocomplete({
			source: function( request, response ) {
				var matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
				response( $.grep( names, function( value ) {
					value = value.label || value.value || value;
					return matcher.test( value ) || matcher.test( normalize( value ) );
				}) );
			}
		});
	});

</script>
  </head>

  <body>
   <jsp:include page="/manual/head.jsp"></jsp:include>
 
  <table width="100%"  border="0" cellpadding="0" cellspacing="0">
  
 <tr>
    	<td width="270" align="center">
    		
    	</td>
    	<td width="100%">
    	</td>
    </tr>
    
    <tr>
    	<td valign="top">
     		<div>
     		
     		</div>
		    <jsp:include page="/user/left.jsp"></jsp:include>
     	</td>
     	
     	
     	<td valign="top" >
     	<form id="addstoreForm" name="addstoreForm" action="addstore.action" method="post" accept-charset="UTF-8">
     <table border="0" cellpadding="0" cellspacing="0" width="100%">
    	 <tr>
     		<td>
     	<table width="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
     		
     		<tr>
     			<td>添加正品网店</td>
     		</tr>
     	</table>
     	</td>
     		</tr>
 <tr>
     		<td><s:fielderror id="errormessage" />
     	
			<table align="left"  border="0"  cellspacing="0" cellpadding="0" >
			<s:token />
				<tr>
					
					<td width="75">网店简称:</td>
					
					<td ><input type="text" id="shortname" name="shortname" size="30" value="<s:property value="shortname"/>"/></td>
					
				</tr>
				
				<tr>
					
					<td width="75">网店名称:</td>
					
					<td ><input type="text" id="name" name="name" size="60"/></td>
					
				</tr>
				<tr>
					<td>网店连接:</td>
					<td ><input type="text" id="url" name="url" size="60"/></td>
				</tr>
				
				<tr>
					<td>图片连接:</td>
					<td ><input type="text" id="image" name="image" size="60" value=""/></td>
				</tr>
				
				<tr>
					<td>网店星级:</td>
					<td>
	<!-- // ================================================================= // -->
	
		
		<div id="demo6" class="demo">
	
		</div>
		
		<script type="text/javascript">
			$('#demo6').rater('star', {maxvalue:10, style: 'basic'});
		</script>
		
	<!-- // ================================================================= // -->
	
	<input name="star" id="star" type="hidden" value="0"/>
	
					
					</td>
				</tr>
				
				<tr>
				
					<td>标签:</td>
				
					<td>
				<%
					//DictionaryOS dictionaryOS = new DictionaryOS();
					Map dictionaryLableMap = dictionaryOS.getDictionaryLableMap();
					Iterator iter = dictionaryLableMap.entrySet().iterator();
					while(iter.hasNext()){
						Map.Entry entry = (Map.Entry)iter.next();
						DictionaryTB dictionary	= (DictionaryTB)entry.getValue();
						
						//if(dictionary.getDictionary_code().equals("MANUAL.LABLE.OTHER")) continue;
				%>
					<input type="radio" id="lable" name="lable" value="<%=dictionary.getDictionary_code() %>"><%=dictionary.getDictionary_value() %></input>
				<%
				
					}
					//dictionaryOS.releaseConnection();
				%>
					
					</td>
				
				</tr>
				
				<tr>
				
					<td>经营品牌(中文):</td>
					<td ><input type="text" id="cnbrand" name="cnbrand" value="<s:property value="cnbrand"/>"/>
					经营品牌(英文): <input id="enbrand" name="enbrand" type="text" maxlength="64" value="<s:property value="enbrand"/>"/>
			    		<font color="red"></font>
					</td>
				</tr>
				
				<tr>
				
					<td>网店简介:</td>
				
					<td >
						
					</td>
				
				</tr>
				
			</table>
		
	</td>
	
	
     		</tr>
     		
     		<tr>
					<td>
		<table align="left"  border="0"  cellspacing="0" cellpadding="0">
    	
     		<tr>
     			<td>
     			<div class="m950 lineDarkBlue"></div>
     			<textarea name="content" id="content" class="editArea" require="true" datatype="LimitB" min="3" max="8000"  msg="商品详细描述必须在[3～30000]个字符之内,一个中文是两个字符!" rows="1" cols="25">
					      
					      </textarea>
					    <script language="javascript">      
					// 安装编辑器
					oEditor = new PPEditor( 'content' );
					oEditor.AllowNumber = 8000;
					//oEditor.Height = 150;
					oEditor.ToolbarSets    = [['Source'],['Bold','Italic','Underline','StrikeThrough'],['SubScript','SuperScript'],['InsertOrderedList','InsertUnOrderedList'],['JustifyLeft','JustifyCenter','JustifyRight'],['CreateLink','UnLink'],['InsertImage'],['TextColor','BGColor'],['FontName','FontSize'],['WordCount']] ;
					oEditor.Create() ; 
					</script>
					<img alt="" src="../comm/editor/auction_ruler.png">
				</td>
     		</tr>
     	</table>
					
					</td>
	
			</tr>
	
     		 <tr>
     		<td>
     		
     		<br>
     		<table >
     			<tr>
					
					<td><input value=" 提交内容 " type="submit" /></td>
					<td></td>
					
				</tr>
     		</table>
		
     	
     	
     	</td>
     	</tr>
     	</table>
     	</form>
	</td>
</tr>
</table>
<jsp:include page="/manual/tail.jsp"></jsp:include>
  </body>
 <script type="text/javascript">


</script>
<%
	databaseConnection.releaseConnection(conn);
%>
</html>
